<!-- <a routerLink="/project/edit" class="oc-add-btn" [mdl-tooltip]="'添加项目'" mdl-button mdl-button-type="fab" mdl-colored="accent"
  mdl-ripple>
  <mdl-icon>add</mdl-icon>
</a> -->

<!-- <mdl-alert
  #confirmAlert
  message="确定删除此项？"
  okText="确定"
  (confirmed)="alertConfirmd()"></mdl-alert> -->
<div class="page-container">
  <div class="data-table-container">
    <div class="btn-container" *ngIf="selected.length" style="margin-bottom: 10px;">
      <button mdl-button mdl-button-type="raised" mdl-colored="primary" mdl-ripple (click)="approve()">
        <mdl-icon class="icon material-icons" mdl-tooltip-position="left">lock_open</mdl-icon>
        批准门禁权限
      </button>
      <button mdl-button mdl-button-type="raised" mdl-colored="accent" mdl-ripple (click)="reject()">
        <mdl-icon class="icon material-icons" mdl-tooltip-position="left">lock</mdl-icon>
        拒绝门禁权限
      </button>
    </div>
    <ngx-datatable (select)='onSelect($event)' [selected]="selected" [selectionType]="'checkbox'" [rows]="rows" [columns]="columns"
      [headerHeight]="40" [rowHeight]="40" [columnMode]="'force'" [headerHeight]="50" [footerHeight]="50" [rowHeight]="'auto'"
      [externalPaging]="true" [messages]="pagerMessage" [count]="count" [offset]="offset" [loadingIndicator]="isPageLoading"
      [limit]="limit" (page)='onPage($event)' class="material fullscreen">
      <ngx-datatable-column name="userName" [checkboxable]="true" [headerCheckboxable]="true">
        <ng-template let-column="column" ngx-datatable-header-template>
          姓名
        </ng-template>
        <ng-template let-value="value" ngx-datatable-cell-template>
          {{ value }}
        </ng-template>
      </ngx-datatable-column>
      <ngx-datatable-column name="startTime">
        <ng-template let-column="column" ngx-datatable-header-template>
          起始时间
        </ng-template>
        <ng-template let-value="value" ngx-datatable-cell-template>
          {{ value ? (value | date: 'dd/MM/yyyy') : '' }}
        </ng-template>
      </ngx-datatable-column>
      <ngx-datatable-column name="endTime">
        <ng-template let-column="column" ngx-datatable-header-template>
          截止时间
        </ng-template>
        <ng-template let-value="value" ngx-datatable-cell-template>
          {{ value ? (value | date: 'dd/MM/yyyy') : '' }}
        </ng-template>
      </ngx-datatable-column>
      <ngx-datatable-column name="mobile">
        <ng-template let-column="column" ngx-datatable-header-template>
          手机号
        </ng-template>
        <ng-template let-value="value" ngx-datatable-cell-template>
          {{ value }}
        </ng-template>
      </ngx-datatable-column>
      <ngx-datatable-column name="desc">
        <ng-template let-column="column" ngx-datatable-header-template>
          到访内容
        </ng-template>
        <ng-template let-value="value" ngx-datatable-cell-template>
          {{ value }}
        </ng-template>
      </ngx-datatable-column>
      <ngx-datatable-column name="visitCompany">
        <ng-template let-column="column" ngx-datatable-header-template>
          到访公司
        </ng-template>
        <ng-template let-value="value" ngx-datatable-cell-template>
          {{ value.name }}
        </ng-template>
      </ngx-datatable-column>
      <ngx-datatable-column name="idCard">
        <ng-template let-column="column" ngx-datatable-header-template>
          身份证号
        </ng-template>
        <ng-template let-value="value" ngx-datatable-cell-template>
          {{ value }}
        </ng-template>
      </ngx-datatable-column>
      <ngx-datatable-column name="status">
        <ng-template let-column="column" ngx-datatable-header-template>
          状态
        </ng-template>
        <ng-template let-value="value" ngx-datatable-cell-template>
          {{ value === 1 ? '已批准' : (value === 0 ? '待审批' : '已拒绝') }}
        </ng-template>
      </ngx-datatable-column>
      <!-- <ngx-datatable-column name="id">
        <ng-template let-column="column" ngx-datatable-header-template>
          操作
        </ng-template>
        <ng-template let-value="value" ngx-datatable-cell-template>
          <a routerLink="edit/{{ value }}" class="table-action-btn">
            <i class="material-icons">edit</i>
          </a>
          <a (click)="delete(value)" class="table-action-btn app-delete-btn">
            <i class="material-icons">delete</i>
          </a>
        </ng-template>
      </ngx-datatable-column> -->
    </ngx-datatable>
  </div>
</div>